import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { MulterModule } from '@nestjs/platform-express';
import { memoryStorage } from 'multer';
import { MatchesService } from './matches.service';
import { MatchesController } from './matches.controller';
import { BettingService } from './betting.service';
import { BettingController } from './betting.controller';
import { Match } from './entities/match.entity';
import { Betting } from './entities/betting.entity';

@Module({
  imports: [
    TypeOrmModule.forFeature([Match, Betting]),
    MulterModule.register({
      storage: memoryStorage(), // 使用内存存储，确保file.buffer可用
      limits: {
        fileSize: 10 * 1024 * 1024, // 10MB
      },
    }),
  ],
  controllers: [MatchesController, BettingController],
  providers: [MatchesService, BettingService],
  exports: [MatchesService, BettingService],
})
export class MatchesModule {}